import {defineStore} from 'pinia'
import categoryApi from '../api/category/reqIndex'
// 第一个参数是你的应用中 Store 的唯一 ID。----category
const useCategoryStore = defineStore('category',{
    state:():any=>({
      // 分类数据名称
      cateList:[],
      //标题地址图片
      bannerUrl:'',
    }),
    actions:{
      async IndexList(){
        try {
          let result = (await categoryApi.getCategory1()) as any;
          this.cateList = (result.global as any).cateList
          console.log(result,'1111');
        } catch (error) {
          console.log(error);
        }
      }
    }
})
export default useCategoryStore;